<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="../../../../resources/layui/css/layui.css"/>

	</head>
	<body>
		<div class="container-fluid">
			<div class="row mheader">
				<div class="col-xs-2 text-left"><a href="javascript:;" onclick="location.href='../../../word.html'"><span class="iconfont icon-fanhui"></span></a></div>
				<div class="col-xs-8"><h2>材料签收</h2></div>
				<div class="col-xs-2 text-right"><a href="#"><span class="iconfont icon-31sousuo sousuo"></span></a></div>
			</div>
			<div class="row">
				<dl class="erp-list" id="list">

				</dl>
			</div>
			<!--搜索-->
			<div class="search-box">
				<div class="search-cover">
					<form action="" method="post">
						<div class="row">
							<div class="col-xs-4">
								<ul class="list-group list-items">
								  <li class="list-group-item list-group-lists search-active">项目名称</li>
								  <li class="list-group-item list-group-lists">开始时间</li>
								  <li class="list-group-item list-group-lists">结束时间</li>
								</ul>
							</div>
							<div class="col-xs-8">
								<div class="search-lists search-list1 search-active">
									<input type="text" class="pro pro-input pro-name" placeholder="请输入项目名称"/>
								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="test01" name="supply_Time" placeholder="请输入开始时间">
								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="test02" name="supply_Time" placeholder="请输入结束时间">
								</div>
							</div>
						</div>
						<div class="row">
							<span class="btns close-cover">取消</span>
							<input class="sub-cover btns fr" type="button" value="确定"/>
						</div>
					</form>
				</div>
			</div>
		</div>
	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/jquery.jedate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../resources/js/template-web.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../resources/layui/layui.js"></script>

<script id="m_list" type="text/html">
	{{each data as value i}}
		<dd>
			<a href="#" onclick="loadDetails('{{value.rm_Code}}','{{value.proName}}','{{value.r_adr}}','{{value.rm_Time}}',
			'{{value.validate==0?"签收完成":value.validate==-1?"等待签收":"拒绝签收"}}',
			'{{value.state==0?"已审核":"等待审核"}}','{{value.compName}}')" >
				<h3>{{value.rm_Code}}
					<span class="btn btn-danger fr">{{value.validate==0?"签收完成":value.validate==-1?"等待签收":"拒绝签收"}}</span>
					<span class="btn btn-danger fr">{{value.state==0?"已审核":"等待审核"}}</span>
				</h3>
				<div class="erp-txt visa-txt">
					<p><span class="sp">项目名称:</span><span class="divCon">{{value.proName}}</span></p>
					<p><span class="sp">申请单号:</span><span class="divCon">{{value.feed_Code}}</span></p>
					<p><span class="sp">供货单位:</span><span class="divCon">{{value.compName}}</span></p>
					<p><span class="sp">收货地址:</span><span class="divCon">{{value.r_adr}}</span></p>
					<p><span>签收时间:</span>{{value.rm_Time}}</p>
				</div>
			</a>
		</dd>
	{{/each}}
</script>
<script>

    layui.use('laydate', function() {
        var laydate = layui.laydate;

        laydate.render({
            elem: '#test01'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#test02'
            ,type: 'datetime'
        });
    })


        //项目名称
        var proName = $(".pro-name").val();
        //起始时间
        var begintime = $("#test01").val();
        //结束时间
        var endtime = $("#test02").val();

        var formData = {
            type:'a',
            proName:'',
            begintime:'',
            endtime:'',
        };
        //滚动加载
        var nloader = LoadMore({
            api: 'api/ctteam/matSignList.do',
            data: formData,
            success: function (data) {
                //传入id来进行渲染
                var html = template('m_list', data);
//                document.getElementById('list').innerHTML =  html;
                $("#list").html( $("#list").html() + html);

            }
        });


    var dat=new Object();
    function loadDetails(rm_code,proName,r_adr,rm_Time,validate,state,compName) {
        var obj = {};
        obj.rm_code = rm_code;
        obj.proName = proName;
        obj.r_adr = r_adr;
        obj.rm_Time = rm_Time;
        obj.validate = validate;
        obj.state = state;
        obj.compName= compName;
        sessionStorage.setItem("obj",JSON.stringify(obj));
        location.href="./erp-details.html";
    }

	$(".sousuo").click(function(){
		$(".search-box").slideToggle();
	})
	$(".list-group-lists").click(function(){
		var i=$(this).index();
		$(".search-lists").hide();
		$(".search-lists").eq(i).show();
		$(".list-group-lists").removeClass("search-active");
		$(this).addClass("search-active");
		$(".pros").hide();
		$(".pros").eq(i).show();
	});

//	点击取消按钮
	$(".close-cover").click(function(){
		$(".search-box").slideUp();
	});
//	点击确定按钮
	$(".sub-cover").click(function(){
	    //调用

		$(".search-box").slideUp();
        $("#list").html('');
        formData.proName=$('.pro').val();
        formData.bengintime=$('#test01').val();
        formData.endtime = $('#test02').val();
        nloader.search();

    })
</script>










